package adapter.abstract_animals.adapter;

import adapter.abstract_animals.Cat;
import adapter.abstract_animals.Dog;

public class Adapter implements Dog,Cat{
    private Dog dog;
    private Cat cat;
    public void setCat(Cat cat) {
        this.cat = cat;
    }
    public void setDog(Dog dog) {
        this.dog = dog;
    }
    public Adapter(Dog dog){
        this.dog = dog;
    }
    public Adapter(Cat cat){
        this.cat = cat;
    }
    public void cry(){
        System.out.print("猫学");
        dog.wang();
    }
    public void catchMouse(){
        cat.catchMouse();
    }
    public void wang(){
        dog.wang();
    }
    public void action(){
        System.out.print("狗学");
        cat.catchMouse();
    }
}
